package task03;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int m =sc.nextInt();
            int n =sc.nextInt();
            int a[][] = new int[m][2];
            int b[][] = new int[n][4];
            for(int i=0;i<m;i++){
                a[i][0] = sc.nextInt();
                a[i][1] = sc.nextInt();
            }
            for(int i=0;i<n;i++){
                b[i][0] =sc.nextInt();
                b[i][1] =sc.nextInt();
                b[i][2] =sc.nextInt();
                b[i][3] =sc.nextInt();
            }
            int ar[] = new int[m];
            for(int i=0;i<m;i++){
                ar[i]=0;
                for(int j=0;j<n;j++){
                    if(a[i][0]>=b[j][0]&&a[i][0]<=b[j][2]&&a[i][1]>=b[j][1]&&a[i][1]<=b[j][3]){
                            ar[i]=2*Math.abs( (b[j][2]-b[j][0]) )+2*Math.abs( (b[j][3]-b[j][1]) );
                            break;
                    }
                }
            }
            Arrays.sort(ar);
            for(int i=ar.length-1;i>=0;i--){
                System.out.println(ar[i]);
            }

        }

    }

}